﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace DTcms.Web.ashx
{
    /// <summary>
    /// addmessage 的摘要说明
    /// </summary>
    public class addmessage : IHttpHandler
    {

        public void ProcessRequest(HttpContext context)
        {
            string name = context.Request["name"].ToString();
            string mail = context.Request["mail"].ToString();
            string website = context.Request["website"].ToString();
            string comment = context.Request["comment"].ToString();
            string site_id = context.Request["site_id"].ToString();
            BLL.msg bll = new BLL.msg();
            Model.msg model = new Model.msg();
            model.title = name;
            model.email = mail;
            model.company = website;
            model.site_id = int.Parse(site_id);
            model.content = comment;

            if (bll.Add(model) > 0)
                context.Response.Write("ok");
            else
                context.Response.Write("error");



        }

        public bool IsReusable
        {
            get
            {
                return false;
            }
        }
    }
}